<p class="center"><%= image_tag('alchemy/alchemy-logo.svg') %></p>
<h2 class="center">
  <%= Alchemy.t("Version") %>: <%= @alchemy_version %>
</h2>
<% if can? :update_check, :alchemy_admin_dashboard %>
<p class="center" id="update_check">
  <span id="update_available">
    <%= render_icon('warning') %>
    <%= Alchemy.t 'Update available' %>
  </span>
  <span id="up_to_date">
    <%= render_icon('ok') %>
    <%= Alchemy.t 'Alchemy is up to date' %>
  </span>
  <span id="error">
    <%= render_icon('warning') %>
    <%= Alchemy.t 'Update status unavailable' %>
  </span>
</p>
<% end %>
<div class="info">
  <%= render_icon('info') %>
  <p><%= Alchemy.t('Alchemy is open software and itself uses open software and free resources:') %></p>
  <ul>
    <li>
      <a href="http://rubyonrails.org" target="_blank">RubyOnRails</a>
    </li>
    <li>
      <a href="http://jquery.com" target="_blank">jQuery Javascript Library</a>
    </li>
    <li>
      <a href="http://jqueryui.com" target="_blank">jQuery UI Javascript GUI Library</a>
    </li>
    <li>
      <a href="http://tinymce.moxiecode.com" target="_blank">TinyMCE - Javascript WYSIWYG Editor</a>
    </li>
    <li>
      <a href="http://blueimp.github.io/jQuery-File-Upload/" target="_blank">jQuery File Upload</a>
    </li>
    <li>
      <a href="http://p.yusukekamiyamane.com" target="_blank">Fugue Icons by Yusuke Kamiyamane</a>
    </li>
  </ul>
</div>
<% if can? :update_check, :alchemy_admin_dashboard %>
<script type="text/javascript">
  (function() {
    var el = $('#update_check');
    var spinner = Alchemy.Spinner.small();
    spinner.spin(el[0]);
    $.get('<%= alchemy.update_check_path %>', function(data, textStatus, jqXHR) {
      if (data == 'true') {
        $('#update_available').show();
      } else {
        $('#up_to_date').show();
      }
    }).fail(function(jqXHR, textStatus, errorThrown) {
      $('#error').show();
    }).always(function() {
      spinner.stop();
    });
  })();
</script>
<% end %>
